/*
 *  Copyright 2025 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../../../../../styles/variables.less';

.kpi-legend {
  border-radius: @border-rad-sm;
  border: 1px solid @grey-15;
  display: flex;
  flex-direction: column;
  gap: @size-xs;
  max-height: 350px;
  overflow-y: auto;

  .legend-dot {
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
  }

  .kpi-full-legend {
    background-color: @grey-26;
    border-radius: @border-rad-sm;
    border: 1px solid @grey-16;
    display: flex;
    flex-direction: column;
    gap: @size-xxs;
    margin-bottom: @size-xs;
    min-width: 0;
    padding: @size-xs;
    width: 100%;
  }

  .kpi-legend-title {
    color: @grey-700;
    flex: 1;
    font-size: @size-sm;
    font-weight: @font-regular;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .kpi-legend-info-icon {
    svg {
      height: @size-sm;
      width: @size-sm;
      color: @grey-400;
    }
  }

  .kpi-legend-value {
    color: @grey-33;
    font-weight: @font-regular;
  }

  .kpi-legend-days-left {
    color: @grey-600;
    font-weight: @font-medium;
  }

  .goal-completed-container {
    align-items: center;
    background-color: @green-9;
    border-radius: @border-rad-xs;
    display: flex;
    flex-shrink: 1;
    font-size: 10px;
    gap: @size-xxs;
    min-width: 0;
    padding: @size-xxs @size-xs;
    width: fit-content;

    .ant-typography {
      color: @green-10;
      margin: 0;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    svg {
      color: @green-10;
      flex-shrink: 0;
      height: @size-sm;
      width: @size-sm;
    }
  }

  .goal-missed-container {
    align-items: center;
    background-color: @yellow-10;
    border-radius: @border-rad-xs;
    color: @yellow-11;
    display: flex;
    flex-shrink: 1;
    font-size: 10px;
    gap: @size-xxs;
    min-width: 0;
    padding: @size-xxs @size-xs;
    width: fit-content;

    .ant-typography {
      color: @yellow-11;
      margin: 0;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    svg {
      color: @yellow-11;
      flex-shrink: 0;
      height: @size-sm;
      width: @size-sm;
    }
  }

  .kpi-legend-header {
    align-items: center;
    display: flex;
    gap: @size-xs;
    justify-content: space-between;
    min-width: 0;
  }

  .kpi-legend-bottom-row {
    align-items: center;
    display: flex;
    gap: @size-xxs;
    justify-content: space-between;
    min-width: 0;
  }

  .kpi-legend-center-section {
    align-items: center;
    display: flex;
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .kpi-legend-value-section {
    flex-shrink: 0;
    min-width: fit-content;
  }
}
